//1. 引入路由
import Vue from "vue";
import VueRouter from "vue-router";

const One = () => import("../components/One");
const Two = () => import("../components/Two");

//2. 把路由作为插件使用
Vue.use(VueRouter);

//3. 实例化路由得到路由对象
export default new VueRouter({
  //设置路由模式为history模式!!!!
  mode: "history",
  //使用routes配置项配置路由表
  routes: [
    {
      path: "/one",
      component: One,
    },
    {
      path: "/two",
      component: Two,
    },
  ],
});
